package com.iee.reactor;

import org.junit.Test;
import reactor.core.publisher.Flux;

import java.time.Duration;
import java.time.temporal.ChronoUnit;

/**
 * @ClassName FlexDemo
 * @Description TODO
 * @Author longxiaonan@163.com
 * @Date 2020/9/11 0011 14:53
 */
public class FlexDemo {

    @Test
    public void testBasic(){
        Flux.just("Hello", "World").subscribe(a -> {
            System.out.println(a);
        });
        Flux.fromArray(new Integer[] {1, 2, 3}).subscribe(System.out::println);
        Flux.empty().subscribe(System.out::println);
        Flux.range(1, 10).subscribe(System.out::println);
        Flux.interval(Duration.of(10, ChronoUnit.SECONDS)).subscribe(System.out::println);
    }

}
